package com.github.m6d21.sso.business.configuration;

import com.github.pagehelper.PageHelper;
import java.util.Properties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 *<p>
 *mybatis分页插件注入
 *</p>
 *
 * @author liuyang
 * @date 2018/12/25 Tue 23:38:00
 * @since 1.0.0
 */
@Configuration
public class PageHelperConfiguration {

    @Bean
    PageHelper pageHelper() {
        PageHelper pageHelper = new PageHelper();
        Properties properties = new Properties();
        properties.setProperty("reasonable", "true");
        properties.setProperty("supportMethodsArguments", "true");
        properties.setProperty("returnPageInfo", "check");
        properties.setProperty("params", "count=countSql");
        pageHelper.setProperties(properties);
        return pageHelper;
    }
}
